<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 

    for   forEach   some   findIndex   filter   map
 -->
    <script>
        var arr = [
            { id: 1, name: 'jack' },
            { id: 2, name: 'jack2' },
            { id: 3 },
            { id: 4, name: 'jack4' },
        ]

        var  data=arr.map(item=>{
            // if(item.id==3){
            //     return true
            // }
            
                return item.name
            
        })
        console.log(data);
    </script>
</body>

</html>